#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
//#include<stdlib.h>

using namespace std;

int main()
{
    FILE* fp = fopen("bite.txt", "w+");
    if (nullptr == fp)
    {
        perror("fopen error");
        exit(-1);
    }
    char buf1[] = "linux so easy\n";
    fwrite(buf1, 1, sizeof(buf1), fp);
    char buf2[30];
    fseek(fp, 0, SEEK_SET);
    fread(buf2, 1, sizeof(buf2), fp);
    printf("%s", buf2);
    fclose(fp);

    return 0;
}